package keer.httpinterface.annotation;

import keer.httpinterface.HttpInterceptor;
import keer.httpinterface.http.HttpMethod;
import keer.httpinterface.proxy.NoBodyRequestAnnotationConfigure;

import java.lang.annotation.*;

/**
 * 指定接口请求http方法为HEAD
 * @see Request
 * @see NoBodyRequestAnnotationConfigure
 * @see Header
 * @see Param
 * @see HttpInterceptor
 *
 * @author keer
 * @since 1.0.0
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Documented
@Request(configure = NoBodyRequestAnnotationConfigure.class, method = HttpMethod.HEAD)
public @interface Head {

    /**
     * 请求地址
     * @return
     */
    @Alias(annotation = Request.class, property = "url")
    String url() default "";

    /**
     * 请求地址
     * @return
     */
    @Alias(property = "url")
    String value() default "";

    /**
     * 请求头
     * @see Header
     * @return
     */
    @Alias(annotation = Request.class, property = "headers")
    Header[] headers() default {};

    /**
     * 请求参数
     * @see Param
     * @return
     */
    @Alias(annotation = Request.class, property = "params")
    Param[] params() default {};

    /**
     * 请求拦截器
     * @see HttpInterceptor
     * @return
     */
    @Alias(annotation = Request.class, property = "interceptors")
    Class<? extends HttpInterceptor>[] interceptors() default {};
}
